package com.ja.openchat.ui.chat.ext;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.ja.openchat.R;
import com.zy.openchat.core.model.message.ChatInfo;
import com.ja.openchat.ui.chat.annotation.ExtContextMenuItem;
import com.ja.openchat.ui.chat.ext.core.ConversationExt;
import com.ja.openchat.ui.chat.redpacket.PostRedPacketActivity;


public class RedPacketExt extends ConversationExt {

    /**
     * @param containerView 扩展view的container
     * @param conversation
     */
    @ExtContextMenuItem
    public void postRed(View containerView, ChatInfo conversation) {
        PostRedPacketActivity.startActivity(fragment.getContext(),conversation);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == Activity.RESULT_OK) {
            if (data != null) {

            }
        }
    }

    @Override
    public boolean filter(ChatInfo conversation) {
        return conversation.isMyFovChat()||conversation.isGroupSendChat();
    }

    @Override
    public int priority() {
        return 4;
    }

    @Override
    public int iconResId() {
        return R.drawable.icon_changered;
//        return R.mipmap.menu_gift;
    }

    @Override
    public String title(Context context) {
        return context.getString(R.string.red_envelope_text);
    }

    @Override
    public String contextMenuTitle(Context context, String tag) {
        return title(context);
    }
}
